package com.research;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class Main extends Activity implements OnClickListener {
	private static final int TAKE_PICTURE_CODE = 1;

	TextView take;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		take = (TextView) findViewById(R.id.take);
		take.setOnClickListener(this);
	}


	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		if (v == take) {

			Intent intent = new Intent(Main.this, RecognitionAc.class);	
			startActivity(intent);
			finish();
		}
	}

	/* take photo 
	private void takePhoto() {
		Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
		//intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri
		//.fromFile(getTempFile(this)));
		startActivityForResult(intent, TAKE_PICTURE_CODE);
	}

	 get temporary file 
	private File getTempFile(Context context) {
		final File path = new File(Environment.getExternalStorageDirectory(),
				context.getPackageName());
		if (!path.exists()) {
			path.mkdir();
		}
		return new File(path, "image.tmp");
	}
	
	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		// TODO Auto-generated method stub
		super.onActivityResult(requestCode, resultCode, data);
		if (resultCode == Activity.RESULT_OK) {

			Bundle extras = data.getExtras();
			Intent intent = new Intent(Main.this, RecognitionAc.class);
			intent.putExtras(extras);
	
			startActivity(intent);
	
			finish();

		}
	}
	*/

}